Fix the request size for a full page-sized skbuff in netfront
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 6 Dec 2005 14:52:15 +0000 (15:52 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 6 Dec 2005 14:52:15 +0000 (15:52 +0100)
driver (must allow 16 bytes for dev_alloc_skb headroom).

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c

index 602cec9ae7f8cddad11050c125472b47ebe8090a..5fd59bc9f5fc51c9c00560c4c8d7cb380eadcf73 100644 (file)
@@ -535,8 +535,12 @@ static void network_alloc_rx_buffers(struct net_device *dev)
         */
        batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
        for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
+               /*
+                * Subtract dev_alloc_skb headroom (16 bytes) and shared info
+                * tailroom then round down to SKB_DATA_ALIGN boundary.
+                */
                skb = alloc_xen_skb(
-                       (PAGE_SIZE - sizeof(struct skb_shared_info)) &
+                       (PAGE_SIZE - 16 - sizeof(struct skb_shared_info)) &
                        (-SKB_DATA_ALIGN(1)));
                if (skb == NULL)
                        break;